import { Shape } from '@antv/x6'
import config, { NODE_SETING_ENUM } from '../config'

export const CustomLine = Shape.Polyline.define({
  constructorName: 'custom-line',
  width: 80,
  height: 3,
  attrs: {
    // root: {
    //   magnet: true
    // },
    body: {
      fill: config.nodeBgColor,
      stroke: config.nodeStroke,
      strokeWidth: 3,
      pointerEvents: 'visiblePainted'
      // magnet: true
    },
    data: {
      width: config.nodeWidth,
      angle: config.nodeAngle
    }
  },
  points: '0,0 80,0',
  data: {
    options: [
      NODE_SETING_ENUM.WIDTH,
      NODE_SETING_ENUM.ANGLE,
      NODE_SETING_ENUM.STROKE,
      NODE_SETING_ENUM.STROKE_WIDTH,
      NODE_SETING_ENUM.LINE_TYPE
    ]
  }
})

// Graph.registerNode('custom-line', CustomLine)
